package com.itheima.stock.mapper;

import com.itheima.stock.common.domain.DayKLinData;
import com.itheima.stock.common.domain.StockIncrease;
import com.itheima.stock.common.domain.StockScreenTimeSharing;
import com.itheima.stock.pojo.StockRtInfo;
import com.itheima.stock.vo.R;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
* @author 陈鑫航
* @description 针对表【stock_rt_info(个股详情信息表)】的数据库操作Mapper
* @createDate 2022-01-08 20:56:19
* @Entity com.itheima.stock.pojo.StockRtInfo
*/
public interface StockRtInfoMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockRtInfo record);

    int insertSelective(StockRtInfo record);

    StockRtInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockRtInfo record);

    int updateByPrimaryKey(StockRtInfo record);

    //查询涨幅榜
    List<StockIncrease> getStockIncrease();

    //查询涨幅榜所有数据，分页由PageHelp实现
    List<StockIncrease> getStockAll();

    /**
     * 查询每日每分钟的涨跌停数据
     * @param type 1 涨停 0 跌停
     * @param avlDate 当前时间
     * @return
     */
    List<Map> getUpDownLimitCount(@Param("type") Integer type, @Param("avlDate") String avlDate);

    List<Map> stockTradeVol4InnerMarket(@Param("time") String time);

    List<Map> getStockUpDown(@Param("timeNow") String timeNow);

    List<StockScreenTimeSharing> stockScreenTimeSharing(@Param("nowDate") String nowDate, @Param("code") String code);


    List<DayKLinData> getDayKLinData(@Param("hisDate") String hisDate, @Param("code") String code);

    /**
     * 分批插入个股数据
     * @param list
     * @return
     */
    int insertBatch(@Param("list") List<StockRtInfo> list);
}
